<!doctype html>

<title>java编辑器</title>
<meta charset="utf-8"/>

<link rel="stylesheet" href="lib/codemirror.css">
<script src="lib/codemirror.js"></script>
<script src="addon/edit/matchbrackets.js"></script>
<link rel="stylesheet" href="addon/hint/show-hint.css">
<script src=addon/hint/show-hint.js"></script>
<script src="mode/clike/clike.js"></script>
<style>.CodeMirror {border: 0px inset #dee;
    min-height:400px;
    height: auto !important;}
.CodeMirror-scroll {
    height: auto !important;
    min-height: 400px;
}
</style>

<div><textarea id="java-code">

</textarea></div>
    <script>
      var editor = CodeMirror.fromTextArea(document.getElementById("java-code"), {
        lineNumbers: true,
        matchBrackets: true,
        mode: "text/x-java"
      });
      editor.on("blur",function(){editor.save();window.apps.change(editor.getValue());})
      editor.on("change",function(){window.apps.change(editor.getValue())});
      editor.setSize('auto','auto');
      var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
      CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";



      window.apps.setInited();
    </script>

